<table class="table" id="ajaxSelector">
    <thead>
        <tr>
            <th> <g:message code="grupo.permissoes.disponiveis.label" default="Permissões Disponiveis" /></th>
            <th> <g:message code="grupo.permissoes.selecionadas.label" default="Permissões Selecionadas" /></th>
        </tr>
    </thead>
    <tbody>
        <tr >
            <td>
                <g:each  in="${totalList - contains}" var="n">
                    <g:remoteLink action="addPermissao" id="${n.id}" update="ajaxSelector"
                          params="['contains': contains?.collect{it.id}, 
                                'totalList': totalList?.collect{it.id}]" >
                        <div> 
                            <span class="label label-default">
                                Manter <g:message code="${n}.label" default=" ${n}" />
                            </span>
                        </div>
                    </g:remoteLink>
                </g:each>
            </td>

            <td>
                <g:each  in="${contains}" var="c">
                    <g:remoteLink action="delPermissao" id="${c.id}" update="ajaxSelector"
                        params="['contains': contains?.collect{it.id},
                            'totalList': totalList?.collect{it.id} ]" >
                        <div>
                          <span class="label label-success">
                              Manter <g:message code="${c}.label" default=" ${c}" />
                          </span>
                          <g:hiddenField name="permissoes.id" value="${c?.id}" />
                        </div>  
                    </g:remoteLink>
                </g:each>
            </td>
        </tr>
    </tbody>
</table>
